UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zMBvrqJsnOLNc1wQciV1yqX3jyn89Z6ZRdSHlgfgwR8='
WHERE
key_id = '4d4b6026e5fc49e6d0b9ee04856b45ab34c5a4b331b16b4233e08f23c57dd591'
AND (
token = 'zMBvrqJsnOLNc1wQciV1yqX3jyn89Z6ZRdSHlgfgwR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)