UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+jZAIn7IpOOfAcJLGcslF2QJARLlro06t6JKDwWs0s=' 
WHERE 
  key_id = '362781efd9f6b1399dd8311d04592df5928c16ac6cf26eb4c9d2537c33298d90' 
  AND (
    token = 'm+jZAIn7IpOOfAcJLGcslF2QJARLlro06t6JKDwWs0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00222