UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wcqtXuo7knwVAhE88nsngBcXVTM8mKfnFX8a8JsTt98='
WHERE
key_id = '70ed0a0d12bf9dcb249577726942eb67cde89f2ba5904e628de95ac7a11e7f22'
AND (
token = 'wcqtXuo7knwVAhE88nsngBcXVTM8mKfnFX8a8JsTt98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)