UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UmeyH4QLdiNi+kLGlBEwHNrGdU7NVdZe45ULA2mqgUM=' 
WHERE 
  key_id = 'e06daf3d0e7931aa2030acb577bfdbe6badaf1f1fa55feb03852e380b45fac84' 
  AND (
    token = 'UmeyH4QLdiNi+kLGlBEwHNrGdU7NVdZe45ULA2mqgUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033