UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TdsiSASJRGm29JfcW1yaZ96zaCZY2dWxzR8hV7/2YKM=' 
WHERE 
  key_id = 'df684c638ab1d85501a12c2667270cdbee66a4a240d3dd1bace42ff56701fefb' 
  AND (
    token = 'TdsiSASJRGm29JfcW1yaZ96zaCZY2dWxzR8hV7/2YKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017