UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zwf3B9u5mtC03CEuxhHWsenOb9L5+rOgtEs4Cr8DSRo='
WHERE
key_id = '82a26b4859b4d8a3b072620bb400b92f2275f3775d83f84f7b67029046c9e2f4'
AND (
token = 'Zwf3B9u5mtC03CEuxhHWsenOb9L5+rOgtEs4Cr8DSRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)