UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dzH2a3M/wB8aB/B6oX9bd8t0q6qc6Tv6dqLiOrDsLI0='
WHERE
key_id = '322863a196b19b4439e225d96dd2b32250cd73b621a83b6aa80b03e666d2b971'
AND (
token = 'dzH2a3M/wB8aB/B6oX9bd8t0q6qc6Tv6dqLiOrDsLI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)