UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FUJDCmAuiaLikNy35Mik4S7gvAUzaGue6Vix3/pgZ1I=' 
WHERE 
  key_id = '2d5adc33ce3e1c5027d7a6f401b50eb60da40abf7eab3f0c5cb4f47218e00742' 
  AND (
    token = 'FUJDCmAuiaLikNy35Mik4S7gvAUzaGue6Vix3/pgZ1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048