UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KYuB3LSOh6k7auBaiLHKgTKZz4lN1wkgLTK/HuKt47E='
WHERE
key_id = 'e327bc9a3763ae9ac988d9d110a367796a232ee704d9776e5bed182e49c1717c'
AND (
token = 'KYuB3LSOh6k7auBaiLHKgTKZz4lN1wkgLTK/HuKt47E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)