UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OdWA4O/iQ5HxksagTjYv7AyLd9nsDGlFfzhJKKO/YvE=' 
WHERE 
  key_id = '1d45e54d61947daac22276059231cf1b2d6fb7df6ae32b35666dc0ce01563d95' 
  AND (
    token = 'OdWA4O/iQ5HxksagTjYv7AyLd9nsDGlFfzhJKKO/YvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034