UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'njD0I2yxBsdTydbGPMxFZ/heC56Zwn/heJmvjSc5StI=' 
WHERE 
  key_id = 'b7ee9a667c880ab9e5efe290d486b56b5d8c2ad80ae63d55f562153231d8e669' 
  AND (
    token = 'njD0I2yxBsdTydbGPMxFZ/heC56Zwn/heJmvjSc5StI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017