UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GIJZ/1adAzfX0g86YTvfWEZvNZzWnO7akUpBzqZRcHA='
WHERE
key_id = '5c3b95b22446732a5e2ccf68db54040e6a92e56b1734bb459d830a44449d86ed'
AND (
token = 'GIJZ/1adAzfX0g86YTvfWEZvNZzWnO7akUpBzqZRcHA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)