UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RqJFibDe7B5Y+EBZe2BAPof2AsaKLboajiMBnF6kNPs=' 
WHERE 
  key_id = '19636cb919875dc8e65152f4b389482b262646a8821fb0207a0c68e832f6c38b' 
  AND (
    token = 'RqJFibDe7B5Y+EBZe2BAPof2AsaKLboajiMBnF6kNPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024