UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LTGjbiQTAog9Q1zSn4BxgnT5d5jNhQXsHekJh6DJzKs='
WHERE
key_id = 'f07d1b3652e84d03e13ed2bd4ee5ad3eb39530797f7caa8c4bd7641e513fe647'
AND (
token = 'LTGjbiQTAog9Q1zSn4BxgnT5d5jNhQXsHekJh6DJzKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)