UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EBPC3AwdS7IuW5USjA4W7tM3UfavpsduxjWqd323++U=' 
WHERE 
  key_id = '0284755ca79ccfa2cf3d08c86cf7bd3832c261b6b89c6941934b63cfa120d218' 
  AND (
    token = 'EBPC3AwdS7IuW5USjA4W7tM3UfavpsduxjWqd323++U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026