UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJcYXC1XfoWa14tg8ON9iRcikT8TTvsIHtNCeK5EGg4='
WHERE
key_id = '190b7285d266fa19489fc0bf1c971ebd37d3390ec0b4e2ff1b7849464c92b4c8'
AND (
token = 'pJcYXC1XfoWa14tg8ON9iRcikT8TTvsIHtNCeK5EGg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)