UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xmoADGiYIz3gDbT7EiiRweEBHJ92AtfmUlGX3xScMEk=' 
WHERE 
  key_id = '25b77d63c540bfb74d09f73acf4e985ca0083c48bec0fcbb965d04c7c4d83a6f' 
  AND (
    token = 'xmoADGiYIz3gDbT7EiiRweEBHJ92AtfmUlGX3xScMEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039