UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mNc84n3m5w2gBB8GlLxMZLAhgXaxSDR0lxytKh/RUEU=' 
WHERE 
  key_id = '74a634c8bd5d53a72f20d36283bed3488caae5f6613dc7385fd903d123c5b066' 
  AND (
    token = 'mNc84n3m5w2gBB8GlLxMZLAhgXaxSDR0lxytKh/RUEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032