UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RLwoiDgkvRny2PZTbkUfoDrHJfVSvw9nqkVO4aHG1D0=' 
WHERE 
  key_id = 'b61be0db881d06142b5048c0581aa202a0b042c17bf29e43725eec1905625572' 
  AND (
    token = 'RLwoiDgkvRny2PZTbkUfoDrHJfVSvw9nqkVO4aHG1D0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029