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

Query time 0.00030