UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RrrZanvZNLpi+MLDxtC+1uY+6+x9vQ+XqFn6ANN4rD8=' 
WHERE 
  key_id = '1860e829212666fb0f36a8c412f2bdc3f3ceff299396f9b1196b6aeea0c9f8c4' 
  AND (
    token = 'RrrZanvZNLpi+MLDxtC+1uY+6+x9vQ+XqFn6ANN4rD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014