UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFZ19xmc9Yh84OrJL6puN62WgA+AMV9YuRVvUtARS48='
WHERE
key_id = 'eaed3d0ff8018fd8c8e14e6a521173f95cf7890625dbd2d543dfa7eb9f0d6ddb'
AND (
token = 'hFZ19xmc9Yh84OrJL6puN62WgA+AMV9YuRVvUtARS48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)