UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NOFr/o5w20s80wRt11VNaqvBd63dknw3AdLRkDCVfwM=' 
WHERE 
  key_id = '7d3fe15bda9887c262b94dd52d5a96dd3887ff08340313743ad7fe77da4c8432' 
  AND (
    token = 'NOFr/o5w20s80wRt11VNaqvBd63dknw3AdLRkDCVfwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031