UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D0z80jWlIUdZqCOntGt+0ElklRCZZD2gFOBa/yOHn34=' 
WHERE 
  key_id = '964a312a0629cab353d5a94516706c8523ac29c8cf6e3bd93a0359d5269c7df5' 
  AND (
    token = 'D0z80jWlIUdZqCOntGt+0ElklRCZZD2gFOBa/yOHn34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037