UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6UmzA9jr4q9tvwEV6b1cLyQVphAtBQUqFtb/FTFQkXI='
WHERE
key_id = '45da393c4ad53144db1bd5f50f365b06f02da06d1b3af4e926e25cd58975d576'
AND (
token = '6UmzA9jr4q9tvwEV6b1cLyQVphAtBQUqFtb/FTFQkXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)