UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vb/P1pdrx1VfB46Npjqps/HaWN53NGRtg+kTIMdgzJg=' 
WHERE 
  key_id = '41788101a4e0eb2c0b96041c24225fcee3acf4503cb4e5be8a7ed441c449f289' 
  AND (
    token = 'Vb/P1pdrx1VfB46Npjqps/HaWN53NGRtg+kTIMdgzJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040