UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1AB0nLfI9DPSYSTmDha0mdgDVEMxs5BLfhyrwV4EvlY=' 
WHERE 
  key_id = 'a8f8158b1e6a75b9400e74b75d1c1d181cb29499f5272883b3bb27d88a096845' 
  AND (
    token = '1AB0nLfI9DPSYSTmDha0mdgDVEMxs5BLfhyrwV4EvlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044