UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8OeCVGg2c6OayqBVnLSnjfGwxHHTF7//4N2uzb4BJ/M='
WHERE
key_id = '4df6a0d458d74a4a7a66287a38a1bbda7695b6e16118f854162ea1eb626876af'
AND (
token = '8OeCVGg2c6OayqBVnLSnjfGwxHHTF7//4N2uzb4BJ/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)