UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wY+hpQDL4A5MBFfKUMyT8kRmwTWpB3m635RhiPX8yl8=' 
WHERE 
  key_id = '33c70beeab6892b0c7842288529642c51ebbcd6be1ab2e90d8ea083b8a6070ce' 
  AND (
    token = 'wY+hpQDL4A5MBFfKUMyT8kRmwTWpB3m635RhiPX8yl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052