UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/2X35B7dKQEKIEGe5MfEx/Cun7Bvm6fpWjQuLXhcWY='
WHERE
key_id = '2c710a441438c48918423aa905d0d955ff8637b8af18928b07c67649d5bbcede'
AND (
token = 'W/2X35B7dKQEKIEGe5MfEx/Cun7Bvm6fpWjQuLXhcWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)