UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vTGDvWF6QLbZCPXAYrABYjNhN6DmBqkBAqnGj3ti6I='
WHERE
key_id = '759e953d476606151bcaa50f35dcb86daff8eccb2aaefeea2c68318b645d1eee'
AND (
token = '5vTGDvWF6QLbZCPXAYrABYjNhN6DmBqkBAqnGj3ti6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)