UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bk/I4V5FLVY89k2SVV5Ook6hAj+R+xoQNP5qTCrDFaw=' 
WHERE 
  key_id = '2408606f53aced937d9c4431df5a6c4fa53a74f7f86b720e2bc09549dbfabe67' 
  AND (
    token = 'Bk/I4V5FLVY89k2SVV5Ook6hAj+R+xoQNP5qTCrDFaw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051