UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'abj0oofToROUlTaKeGIKSxdDGCJD2RdkXsLCGpNwyl0=' 
WHERE 
  key_id = 'c60679b593dfe536cbf2358567a82859622eb8b2b443dc9869601e5ad35fc5d8' 
  AND (
    token = 'abj0oofToROUlTaKeGIKSxdDGCJD2RdkXsLCGpNwyl0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041