UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'takYvr7wlnhZRHD2Dc0dt2BRp9pQsl1eSIdh0PgpjgU='
WHERE
key_id = '441bed9c91844d964d09e4653ad0b381ca612b4ed8a730f961f9da11f896667f'
AND (
token = 'takYvr7wlnhZRHD2Dc0dt2BRp9pQsl1eSIdh0PgpjgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)