UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o3hYrhjo4D7kk4ANHwh4tWyKAfjibdClJ+ui3HJ409g=' 
WHERE 
  key_id = '6906933e071d093b03b87ad1dbad61e5e642c7626230a6a7c651f02e608d3a6f' 
  AND (
    token = 'o3hYrhjo4D7kk4ANHwh4tWyKAfjibdClJ+ui3HJ409g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029