UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bqAVOvJr+j8u88NUXhxlCLlE6OAl5/fokJnX2MeAJC0=' 
WHERE 
  key_id = '63af46d33e4f7d941e0d89acb9719fda5c51c7a0e181f13fe5fc0a9ff8b10833' 
  AND (
    token = 'bqAVOvJr+j8u88NUXhxlCLlE6OAl5/fokJnX2MeAJC0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060