UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KmStEeXKuGB3Ez/FFUkBklPXL3nAePbVcR/x+Kxf3/U=' 
WHERE 
  key_id = '9de73cbc7207f798aa8140f57ea3f9a0145f8855fece9428b9d081346587900e' 
  AND (
    token = 'KmStEeXKuGB3Ez/FFUkBklPXL3nAePbVcR/x+Kxf3/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041