UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UBmvwlvGcJklGHFd7yUb4J0ybUCnMis3Sbq2Y/eNU4w=' 
WHERE 
  key_id = '59091142795bb198b2f1b4a4b1938f8aa88d7c97b72c06824c35719b0c8b6810' 
  AND (
    token = 'UBmvwlvGcJklGHFd7yUb4J0ybUCnMis3Sbq2Y/eNU4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016