UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bXVs11JuJXfkhFlyHxT4/xfPd5bE/aoA8mRAXfkiXpg='
WHERE
key_id = 'a6cbd468b22d8838042954675f20ba3927e5560eee37da75196ebec84fcc8e01'
AND (
token = 'bXVs11JuJXfkhFlyHxT4/xfPd5bE/aoA8mRAXfkiXpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)