UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9qC/QoKAZmaBLgUnauLaf4KQoJNNyhCzT2X+/6bGOlA='
WHERE
key_id = 'fd366e246333f1c1d73b2be0406124bee63c43d5b5ec361ec2b5e871ea2065d1'
AND (
token = '9qC/QoKAZmaBLgUnauLaf4KQoJNNyhCzT2X+/6bGOlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)