UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FBuSxMh5yKOuhvLRI7LlUqn+gNocE+aMFN+NCZdtQ1g=' 
WHERE 
  key_id = '7fee83a2aa5c8590537a1aa1d9bfc6194ea99f4162006d64729c0e8a7491a585' 
  AND (
    token = 'FBuSxMh5yKOuhvLRI7LlUqn+gNocE+aMFN+NCZdtQ1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030