UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XkxGWqzliPv/CutSwGHQyKFpDZoVKMxkFPdRWqySsMU=' 
WHERE 
  key_id = '5cb45eabed5e598439995e53487ae2336dd5bbd48c4c5f31370b5489ef3893c9' 
  AND (
    token = 'XkxGWqzliPv/CutSwGHQyKFpDZoVKMxkFPdRWqySsMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025