UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzAABT6w1eACyQZ7yGlSOF3izop6q19MFxR4qY0mPJY=' 
WHERE 
  key_id = 'a1934698b6183df28aee8cb31e1bd3cf8d7d0ff68f07c6ac1693c422a68f96f1' 
  AND (
    token = 'WzAABT6w1eACyQZ7yGlSOF3izop6q19MFxR4qY0mPJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033