UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e3i4tgF5rJmJSJmx0SWs+ZvPVXd5RDfs6QTW68syEQQ='
WHERE
key_id = '068644c9a0b125c2fbc1984bfa49d7d10424d08b628f44e9c6b3a1434ad397e5'
AND (
token = 'e3i4tgF5rJmJSJmx0SWs+ZvPVXd5RDfs6QTW68syEQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)