UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWsLesstcyh2OX81UGlOcl90gFKCxPdt/jla3MGdKGU=' 
WHERE 
  key_id = '3b7a1f8ae39b1b51934f1b3f9f109b3be992404710024dd3e2541b7e5db81e0b' 
  AND (
    token = 'UWsLesstcyh2OX81UGlOcl90gFKCxPdt/jla3MGdKGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022