UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6mrgITGGlBiIENoh+PfzP7PiYxxALV4XLDKa3PQ+PK8='
WHERE
key_id = '1a24b3f1d761f6dcb429efe7ea6b20ab183fee22e2924b47fd8c2731d8df30ec'
AND (
token = '6mrgITGGlBiIENoh+PfzP7PiYxxALV4XLDKa3PQ+PK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)