UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6aok7uRNheSirTVn2nsP9kwHNQIJYLppYVLb996FS3s='
WHERE
key_id = 'df6ba4e9d54ba8aa8fea96047d1ddc0e48177c7fc99ec80258d174bcfa5c899d'
AND (
token = '6aok7uRNheSirTVn2nsP9kwHNQIJYLppYVLb996FS3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)