UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0jGu4dguh0w9K76XXknhllmEOEnm+XnRNa4VhUXNQO4=' 
WHERE 
  key_id = '1356ecfcdf094737ab652390314b9126860af2dc65913610ef72bf43065c0964' 
  AND (
    token = '0jGu4dguh0w9K76XXknhllmEOEnm+XnRNa4VhUXNQO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030