UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wrTEm4mnfkWHWBdRNNcyYXNcE/1db1SorjhWDeeXA1I=' 
WHERE 
  key_id = '2e87c4db0e2de68e3079d48b6683eef1a7e5000466ca1aec7ef310868d34169b' 
  AND (
    token = 'wrTEm4mnfkWHWBdRNNcyYXNcE/1db1SorjhWDeeXA1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019