UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kWkoXmsaxkDwS6L1KQ3uQdW64iQtuIZeAzSGq/xqQ30=' 
WHERE 
  key_id = '8225d9767da893522523202b56081c6b13143fd1ff3197c61ae7dac3d9ff83fe' 
  AND (
    token = 'kWkoXmsaxkDwS6L1KQ3uQdW64iQtuIZeAzSGq/xqQ30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026