UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ny/q/6xO9HPyh8qXcclLZo37kwHahDM+wOOfCotK7Ew=' 
WHERE 
  key_id = 'c9b58aa5c5b1d7687f3ad3c143fd4dc7081e41a7868f949bfe002aad7614426b' 
  AND (
    token = 'ny/q/6xO9HPyh8qXcclLZo37kwHahDM+wOOfCotK7Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041