UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eFSSleGYkZqpF5rNSqw2mXO44kzNFo9OALy29SiA6sI=' 
WHERE 
  key_id = '35605fb6a75bf59e192e979ec61b91edfb1a721803f1476bec9a3b58f53a99f2' 
  AND (
    token = 'eFSSleGYkZqpF5rNSqw2mXO44kzNFo9OALy29SiA6sI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048