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

Query time 0.00044