UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '02d0uV/aKf1w1YFPKkvVY4CstUnrEmJ79K5uZ2I6e3A=' 
WHERE 
  key_id = '49a474405362850aa2f7bada806f55c786f4fb6fe91b067f61a7ce9a15b17bb3' 
  AND (
    token = '02d0uV/aKf1w1YFPKkvVY4CstUnrEmJ79K5uZ2I6e3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061