UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z3ZFwO0HDwf13yrfV40j8rwaQ5ciNzg/1oxoN1JkKOI=' 
WHERE 
  key_id = 'b28bff75b45798d303ab1939954ea2c036d0ba2085eff85c33e9257621c6793a' 
  AND (
    token = 'Z3ZFwO0HDwf13yrfV40j8rwaQ5ciNzg/1oxoN1JkKOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072