UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f6MQLsed1Aeqt0qLuWUFLVXPUDP+TbMV8dEMtqW4Lb0=' 
WHERE 
  key_id = '7694f73080113b57c54d909c4a4345ef83c5c547fbfdcd193af5d72287046ee8' 
  AND (
    token = 'f6MQLsed1Aeqt0qLuWUFLVXPUDP+TbMV8dEMtqW4Lb0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019