UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sy/bF/igGhBXvagk91PxgfNewOeFNLZntsG/iYmUhVA=' 
WHERE 
  key_id = '592377d64190a08a4d44267c683868d77469f1442b1d131fc774a4ed6bffe10c' 
  AND (
    token = 'sy/bF/igGhBXvagk91PxgfNewOeFNLZntsG/iYmUhVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059