UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RTx1z48ZNvrLvrta3Ptt6SwEI/JIztL1JzJIASlr6Ng=' 
WHERE 
  key_id = 'ebc3de917f917ccf54a3f42acdcfaefa18e8c1df9c647178042ec92d906017db' 
  AND (
    token = 'RTx1z48ZNvrLvrta3Ptt6SwEI/JIztL1JzJIASlr6Ng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038