UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W4VseBed8mqAzpXeZlZhJNvctD+7mQtXyH9U2i6oNcs='
WHERE
key_id = '73ba02da88e3c3a6e9aa390184e62e8652879bf4adff96b16aca317099c0fe39'
AND (
token = 'W4VseBed8mqAzpXeZlZhJNvctD+7mQtXyH9U2i6oNcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)