UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '55bki1ITKj9vjWZv9AHe2DfPN5/0grtaU7b6l0cBFoE=' 
WHERE 
  key_id = '20f1ca55f8f2af64fa67bfc51ec0229cac5de1eaecc43f89d8685d086906bddb' 
  AND (
    token = '55bki1ITKj9vjWZv9AHe2DfPN5/0grtaU7b6l0cBFoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022