UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gYBrP6uTA7Rd+WtLL96PXj7zaXb94rdSSVZmzOTz148='
WHERE
key_id = '43c626c1b58839c1bdcc4c623b427ed27fd3135036c8e2d4da174c258032dfb8'
AND (
token = 'gYBrP6uTA7Rd+WtLL96PXj7zaXb94rdSSVZmzOTz148='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)