UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gO11KX4nZcX5TKr83oLoQWHgGf3pZcgdaZWvv/WZ7R4='
WHERE
key_id = '8fcdf614ca6fdbe369cfe3620a1966eb89b866cde8fb631abcbd8c0dc04451e5'
AND (
token = 'gO11KX4nZcX5TKr83oLoQWHgGf3pZcgdaZWvv/WZ7R4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)