UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+N6613ETwdmRPAT3p/MrfsN+ePMg+3CJ/7RcjdTos5U=' 
WHERE 
  key_id = '4c08644d19ea0557a794b6925c7b072619ad0cb1212e9363057d499bd1eaf5d1' 
  AND (
    token = '+N6613ETwdmRPAT3p/MrfsN+ePMg+3CJ/7RcjdTos5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039