UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jFFAKuQ3Ja7WOsKB4bgFs1DDhMGkjtMFE8bzCEAJU1I=' 
WHERE 
  key_id = '5b4d767fc632d21e0979bd99356051fbc54fafae50be41c36ff2231f0ed99516' 
  AND (
    token = 'jFFAKuQ3Ja7WOsKB4bgFs1DDhMGkjtMFE8bzCEAJU1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015