UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bj9LXOUqLj7p0sC5HMWcKDec/nl/mmxvyifT1dIFwvc='
WHERE
key_id = '512c6d42c1bd2ab10dcbfd3edb782586af0d02d5fb4a8d9ccb5985b6cb6161a4'
AND (
token = 'bj9LXOUqLj7p0sC5HMWcKDec/nl/mmxvyifT1dIFwvc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)