UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C3UmFeeKHfSWNL1HscuPCgM3+UxD0/SoSeVl/YDPk1o=' 
WHERE 
  key_id = '364926b5f1116a4ebe7f9f06c4f9807822c70f3aadf6863f20a1479e309c6d12' 
  AND (
    token = 'C3UmFeeKHfSWNL1HscuPCgM3+UxD0/SoSeVl/YDPk1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00235