UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o35bxPNfNnTN1JhBbGaSkuEFcFWRTYbiXj2er6H19x0=' 
WHERE 
  key_id = '0daa1718eb305566562c5b3e7a1fc94c5d7ca90a73e3e4af794d02ce4216e0a7' 
  AND (
    token = 'o35bxPNfNnTN1JhBbGaSkuEFcFWRTYbiXj2er6H19x0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036