UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CWf5dFy8Lbb/YNuDBxu+8yOhMLXqnnX7fGLSImH65zE='
WHERE
key_id = 'ab06ac9981605caeebe2e1c97d13fe0930ff0c52e9022ad7c28371234b0a2faf'
AND (
token = 'CWf5dFy8Lbb/YNuDBxu+8yOhMLXqnnX7fGLSImH65zE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)